import React from 'react'
// ===================================================================== Temp
import Table from '#cpt/temp/Table'
import SpecCode from '#tp/specCode'
// ===================================================================== global declare
const { $fn } = window
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
		selectedKeys:[],
	}
	model = {}
	componentDidMount(){
		// setTimeout(() => this.props.onFetch())
	}
	fetch = () => $fn.fetch.call(this,'specimen-kind-record/doubleList',{isIndex:true} )
	
	clearSelect = () => this.setState({selectedKeys:[]})
	
	cols = [
		{ title: '条码号', 		dataIndex: 'spec_code',  			...SpecCode(),  			sorter:true },
		{ title: '医院名称', 	dataIndex: 'hosp_name', 			 width:200 },
		{ title: '标本箱号', 	dataIndex: 'box_num',				...$fn.table.exp_num,	 },
		{ title: '采集时间', 	dataIndex: 'coll_time',  			...$fn.table.time,  		sorter:true },
		{ title: '采集类型', 	dataIndex: 'collect_type_name',  	width:100  },
		{ title: '录入时间', 	dataIndex: 'arrival_time',  		...$fn.table.time,			sorter:true, },
		{ title: '第三方来源', 	dataIndex: 'third_source_type_name', width:150 },
		{ title: '第三方条码', 	dataIndex: 'third_spec_code', 		 width:150 },
		{ title: '第三方医院', 	dataIndex: 'third_hosp_name', 		 width:150 },
	]
	render(){
		return (
			<>
				{/* 子表格 */}
				{Table.call(this,{ type: 1, isIndex:true, sort:true,
					onRow: ( {spec_code} )=>{
						this.props.setEntryType()
						this.props.clearSelect()
						this.props.onRow(spec_code)
					},
				})}
			</>
		)
	}
}

export default Index
// 双录入调整，分别显示第一次录入，第二次录入 2022/6/17  --马婷